package com.baigu.admin.server.controller.manage;

import com.baigu.common.base.BaseController;
import com.baigu.product.dao.model.BgProductExample;
import com.baigu.product.rpc.api.BgProductService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 产品controller
 * Created by baigu on 2017/2/6.
 */
@Controller
@Api(value = "产品管理", description = "产品管理")
@RequestMapping("/manage/product")
public class BgProductController extends BaseController {

    private static final Logger LOGGER = LoggerFactory.getLogger(BgProductController.class);

    @Autowired
    private BgProductService bgProductServiceService;


    @ApiOperation(value = "产品首页")
//    @RequiresPermissions("product:permission:read") 权限开发的时候可以先不加
    @RequestMapping(value = "/index", method = RequestMethod.GET)
    public String index() {
        return "/manage/product/index.jsp";
    }

    @ApiOperation(value = "产品列表")
//    @RequiresPermissions("product:permission:read")
    @RequestMapping(value = "/list", method = RequestMethod.GET)
    @ResponseBody
    public Object list() {
        return bgProductServiceService.selectByExample(new BgProductExample());
    }

}
